<div class="my-account">
    <div class="dashboard">
        <div class="welcome-msg">
            <p class="hello"><strong>Hello, <?php echo $userAccount->Profile->first_name.' '.$userAccount->Profile->last_name?>!</strong></p>
            <p>From your My Account Dashboard you have the ability to view a snapshot of your recent account activity and update your account information. Select a link below to view or edit information.</p>
        </div>
        <div class="box-account box-recent">
            <div class="box-head">
                <h2>Recent Orders</h2>
                <?php echo _link('main/myOrders')->text('View All')?>
            </div>
            <table id="my-orders-table" class="data-table">
                <col width="1">
                <col width="1">
                <col>
                <col width="1">
                <col width="1">
                <col width="1">
                <thead>
                    <tr class="first last">
                        <th>Order #</th>
                        <th>Date</th>
                        <th>Ship To</th>
                        <th><span class="nobr">Order Total</span></th>
                        <th>Status</th>
                        <th>&nbsp;</th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach($userRecentOrders as $key=>$userRecentOrder):?>
                    <tr class="first <?php ($key%2==1)?'odd':'even'?>">
                        <td><?php echo ($userRecentOrder->id+1000000)?></td>
                        <td><span class="nobr"><?php echo date('d/m/Y',strtotime($userRecentOrder->created_at))?></span></td>
                        <td><?php echo $userRecentOrder->DmUser->Profile->first_name.' '.$userRecentOrder->DmUser->Profile->last_name?></td>
                        <td><span class="price">BDT: <?php echo $userRecentOrder->total_cost?></span></td>
                        <td><em><?php echo $userRecentOrder->status?></em></td>
                        <td class="a-center last">
                            <span class="nobr">
                                <?php echo _link('main/viewOrder')->param('order_id',$userRecentOrder->id)->text('View Order')?>
                                
                            </span>
                        </td>
                    </tr>
                    <?php endforeach;?>
                </tbody>
            </table>
        </div>
        <div class="box-account">
            <div class="box-head">
                <h2>Account Information</h2>
            </div>
            <div class="col2-set">
                <div class="col-1">
                    <div class="box">
                        <div class="box-title">
                            <h3>Contact Information</h3>
                            <?php echo _link('main/addressBook')->currentSpan(false)->param('address_edit',true)->text('Edit')?>
                        </div>
                        <div class="box-content">
                            <p>
                                <?php echo _tag('div',_tag('label','Full Name').$userAccount->Profile->first_name.' '.$userAccount->Profile->last_name )?>
                                <?php echo _tag('div',_tag('label','Email Address').$userAccount->email)?>
                                <?php echo _tag('div.changePassword',_link('main/accountInformation')->text('Change Password'))?>

                            </p>
                        </div>
                    </div>
                </div>    
            </div>
            <div class="col2-set">
                <div class="box">
                    <div class="box-title">
                        <h3>Address Book</h3>
                        <?php echo _link('main/addressBook')->currentSpan(false)->param('address_edit',true)->text('Manage Addresses')?>
                    </div>
                    <div class="box-content">
                        <address>
                                <?php echo _tag('div',_tag('label','Full Name').$userAccount->Profile->first_name.' '.$userAccount->Profile->last_name) ?>
                                <?php echo _tag('div',_tag('label','Address').$userAccount->Profile->street_address1.', '. $userAccount->Profile->street_address2)?>
                                <?php echo _tag('div',_tag('label','City').$userAccount->Profile->city)?>
                                <?php echo _tag('div',_tag('label','Post Code').$userAccount->Profile->post_code) ?>
                                <?php echo _tag('div',_tag('label','Country').$userAccount->Profile->country) ?>
                                <?php echo _tag('div',_tag('label','Contact Number').$userAccount->Profile->phone_no) ?>
                            <br>
                            <?php //echo _link('main/addressBook')->currentSpan(false)->param('address_edit',true)->text('Edit Address')?>

                        </address>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
